﻿using System.Collections.Generic;
namespace Calendar.Domain
{
    public class TimerHandler
    {
        public UpdateHandler Update = null;
        Pomodoro _pomodoro;
        ThirtyTimer _thirtyTimer;

        public TimerHandler()
        {
            _pomodoro = new Pomodoro();
            _thirtyTimer = new ThirtyTimer();
            _pomodoro.Update += ProcessUpdate;
            //_thirtyTimer.Update += TimerLabelUpdate;
        }

        public void SetTimeAllocation(int timeSlot, int breakTime)
        {
            _pomodoro.SetTimeAllocation(timeSlot, breakTime);
        }

        public string TimerLabelText
        {
            get
            {
                return _pomodoro.TimerLabelText;
            }
        }

        //public string ThirtyTimerProgressText
        //{
        //    get
        //    {
        //        return _thirtyTimer.ThirtyTimerProgressText;
        //    }
        //}

        public int PomodoroProgressBarValue
        {
            get
            {
                return _pomodoro.PomodoroProgressBarValue;
            }
        }

        public void StartPomodoro()
        {
            _pomodoro.StartPomodoro();
        }

        public void StopPomodoro()
        {
            _pomodoro.StopPomodoro();
        }

        public void ProcessUpdate()
        {
            Update.Invoke();
        }

        public void TimerLabelUpdate()
        {
            Update.Invoke();
        }

        public string GetName(int index)
        {
            return _thirtyTimer.GetName(index);
        }

        public int GetTime(int index)
        {
            return _thirtyTimer.GetTime(index);
        }

        public void SetStepsCount(int maxSteps)
        {
            _thirtyTimer.SetStepsCount(maxSteps);
        }

        public string[] GetStepCount()
        {
            return _thirtyTimer.GetStepCount();
        }

        public void SetWorkStep(int id, string name, int time)
        {
            _thirtyTimer.SetWorkStep(id, name, time);
        }

        public string[] ShowWorkStepList()
        {
            return _thirtyTimer.ShowWorkStepList();
        }

        public void StartThirtyTimer()
        {
            _thirtyTimer.StartThirtyTimer();
        }

         
    }
}
